import { getItem } from '~/utils/localStorage'

/**
 * 判断按钮权限是否存在
 * @param {String} permission 
 */
const usePermission = (permission) => {
  const permissions = getItem('permissions')
  if(permissions) {
    if(permissions.indexOf(permission) !== -1) {
      return true
    }
    return false
  }
  return false
}

export default usePermission